<?php

// +----------------------------------------------------------------------

// | ThinkPHP [ WE CAN DO IT JUST THINK ]

// +----------------------------------------------------------------------

// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.

// +----------------------------------------------------------------------

// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )

// +----------------------------------------------------------------------

// | Author: liu21st <liu21st@gmail.com>

// +----------------------------------------------------------------------

use think\facade\Route;



//小程序

Route::group(function (){
    //授权（不需要验证）
    Route::rule('miniapp/passport','miniapp.Main/passport');
    Route::rule('miniapp/member_info','miniapp.member.Member/member_info');

    //平台不用登录
    Route::group(function (){

        //首页
        Route::rule('miniapp/bannerList','miniapp.Index/bannerIndex');

        Route::rule('miniapp/activities','miniapp.Index/activities');

        Route::rule('miniapp/shopList','miniapp.Index/shopIndex');

        Route::rule('miniapp/getPinTuanGoodsList','miniapp.goods.PinTuan/getPinTuanGoodsList');//拼团列表

        Route::rule('miniapp/getFlashSaleGoodsList','miniapp.goods.FlashSale/getFlashSaleGoodsList');//秒杀列表

        Route::rule('miniapp/search','miniapp.Index/search');//搜索

        Route::rule('miniapp/getCity','miniapp.Index/getCity');//获取城市数据
        Route::rule('miniapp/notice_list','miniapp.Index/notice_list');//获取通知数据

        Route::rule('miniapp/cs','miniapp.Index/cs');//获取通知数据

    })->middleware([\app\stores\middleware\PlatformCheck::class]);
    //平台要登录
    Route::group(function (){
        Route::rule('miniapp/searchIndex','miniapp.Index/searchIndex');//获取搜索记录
        Route::rule('miniapp/delSearch','miniapp.Index/delSearch');//删除搜索记录


        //拼团
        Route::rule('miniapp/showPinTuanDetail','miniapp.goods.PinTuan/showPinTuanDetail');//获取邀请拼团详情

        Route::rule('miniapp/getGoodsOrderList','miniapp.order.Order/getGoodsOrderList');

        Route::rule('miniapp/orderDetail','miniapp.order.Order/orderDetail');

        Route::rule('miniapp/applyForRefund','miniapp.order.Order/applyForRefund');

        Route::rule('miniapp/refund','miniapp.order.Order/refund');
        Route::rule('miniapp/CancelGoodsOrder','miniapp.order.Order/cancelOrder');

        Route::rule('miniapp/generalShopList','miniapp.order.Order/generalShopList');
        Route::rule('miniapp/yesOrder','miniapp.order.Order/yesOrder');
        //我的
        Route::rule('miniapp/getMemberInfo','miniapp.member.Member/show');
        Route::rule('miniapp/getMemberRole','miniapp.member.Member/getMemberRole');
        Route::rule('miniapp/getMemberMoneyLogs','miniapp.member.Member/getMemberMoneyLogs');
        Route::rule('miniapp/getMemberCard','miniapp.member.Member/getMemberCard');
        Route::rule('miniapp/getMemberCoupons','miniapp.member.Coupon/getMemberCoupons');

        Route::rule('miniapp/getMemberBuyLogs','miniapp.buy.Buy/getMemberBuyLogs');//平台买单记录

        //我的拼团
        Route::rule('miniapp/getMyPintuanOrderList','miniapp.goods.PinTuan/getMyPintuanOrderList');//我的拼团订单

        Route::rule('miniapp/getPinTuanDetail','miniapp.goods.PinTuan/getPinTuanDetail');//获取拼团详情

        Route::rule('miniapp/CancelPinTuan','miniapp.goods.PinTuan/cancelPinTuan');//取消拼团

        Route::rule('miniapp/CancelPinTuanGoodsOrder','miniapp.goods.PinTuan/cancelPay');//取消拼团支付

        Route::rule('miniapp/saveMemberInfo','miniapp.member.Member/saveMemberInfo');
        Route::rule('miniapp/saveMemberFace','miniapp.member.Member/saveMemberFace');
        Route::rule('miniapp/consume_list','miniapp.Consume/list');
        Route::rule('miniapp/consume_made_list','miniapp.Consume/made_list');
        Route::rule('miniapp/partner_list','miniapp.Partner/index');
        Route::rule('miniapp/partner_info','miniapp.Partner/info');
        Route::rule('miniapp/pro_list','miniapp.Partner/pro_list');
        Route::rule('miniapp/member_list','miniapp.Partner/member_list');
        Route::rule('miniapp/task_list','miniapp.Partner/list');
        //提现账户
        Route::rule('miniapp/withdrawAccountList','miniapp.withdraw.Index/withdrawAccountList');
        Route::rule('miniapp/saveWithdrawAccount','miniapp.withdraw.Index/saveWithdrawAccount');
        Route::rule('miniapp/withdrawAccount','miniapp.withdraw.Index/withdrawAccount');
        Route::rule('miniapp/saveWithdrawAccountDefault','miniapp.withdraw.Index/saveWithdrawAccountDefault');
        Route::rule('miniapp/delWithdrawAccount','miniapp.withdraw.Index/delWithdrawAccount');

    })->middleware([\app\stores\middleware\PlatformCheck::class,\app\stores\middleware\PlatformMemberCheck::class]);
    //店铺不需要登录
    Route::group(function (){
        //店铺详情
        Route::rule('miniapp/shopInfo','miniapp.Shop/info');
        //配送设置信息
        Route::rule('miniapp/getShopSendInfo','miniapp.Goods/getShopSendInfo');
        //拼团
        Route::rule('miniapp/getPinTuanGoodsDetail','miniapp.goods.PinTuan/getPinTuanGoodsDetail');
        Route::rule('miniapp/getPinTuanSetMealDetail','miniapp.goods.PinTuan/getPinTuanSetMealDetail');
        Route::rule('miniapp/getGroupList','miniapp.goods.PinTuan/getGroupList');//获取拼团商品的拼团列表

        //秒杀
        Route::rule('miniapp/CreateFlashSaleGoodsOrder','miniapp.goods.FlashSale/createOrder');//秒杀商品下单

        Route::rule('miniapp/getFlashSaleGoodsList','miniapp.goods.FlashSale/getFlashSaleGoodsList');//获取秒杀商品

        Route::rule('miniapp/getFlashSaleGoodsDetail','miniapp.goods.FlashSale/getFlashSaleGoodsDetail');//获取秒商品详情
        Route::rule('miniapp/getFlashSaleSetMealDetail','miniapp.goods.FlashSale/getFlashSaleSetMealDetail');//获取秒杀套餐详情


        Route::rule('miniapp/shopActivities','miniapp.Shop/activities');

        Route::rule('miniapp/shopPackageList','miniapp.Shop/packageList');

        Route::rule('miniapp/recommendGoodsList','miniapp.Shop/recommendGoodsList');


        //券
        Route::rule('miniapp/getCouponDatas','miniapp.coupon.Coupon/getCouponDatas');


        Route::rule('miniapp/getSetMealDetail','miniapp.goods.SetMeal/getSetMealDetail');

        Route::rule('miniapp/getGoodsCategory','miniapp.goods.Goods/getGoodsCategory');

        Route::rule('miniapp/getGoodsList','miniapp.goods.Goods/getGoodsList');

        Route::rule('miniapp/getGoodsDetail','miniapp.goods.Goods/getGoodsDetail');




    })->middleware([\app\stores\middleware\MiniappCheck::class]);
    //店铺需要登录
    Route::group(function (){
        //领券
        Route::rule('miniapp/getCoupon','miniapp.coupon.Coupon/getCoupon');

        //用户
        Route::rule('miniapp/getMemberQrcode','miniapp.member.Member/getMemberQrcode');
        Route::rule('miniapp/shopMemberInfo','miniapp.member.Member/shopMemberInfo');
        Route::rule('miniapp/getMemberBalanceLogs','miniapp.member.Member/getMemberBalanceLogs');
        Route::rule('miniapp/mobileAuth','miniapp.member.Member/mobileAuth');
        Route::rule('miniapp/getMobile','miniapp.member.Member/getMobile');

        Route::rule('miniapp/isCollect','miniapp.Goods/isCollect');
        Route::rule('miniapp/goodsCollect','miniapp.Goods/goodsCollect');

        Route::rule('miniapp/getGoodsListByGoodsIds','miniapp.Goods/getGoodsListByGoodsIds');


        Route::rule('miniapp/getBuyInit','miniapp.buy.Buy/init');


        //购物车
        Route::rule('miniapp/saveCart','miniapp.Cart/save');

        Route::rule('miniapp/getCartList','miniapp.Cart/getCartList');

        Route::rule('miniapp/delCart','miniapp.Cart/del');

        //订单

        Route::rule('miniapp/goodsData','miniapp.Goods/goodsData');//详情直接下单

        Route::rule('miniapp/CreateGoodsOrder','miniapp.Goods/createOrder');//商品下单

        Route::rule('miniapp/getGoodsMallPayment','miniapp.Payment/getGoodsMallPayment');//商城订单下支付

        Route::rule('miniapp/getGoodsOrderPlatformMoneyPay','miniapp.order.Order/getGoodsOrderPlatformMoneyPay');//钱包支商城订单

        Route::rule('miniapp/getGoodsOrderMoneyPay','miniapp.order.Order/getGoodsOrderMoneyPay'); //订单的余额支付

        Route::rule('miniapp/getBuyPayment','miniapp.Payment/getBuyPayment');//微信买单

        Route::rule('miniapp/buyPlatformMoneyPayment','miniapp.buy.Buy/buyPlatformMoneyPayment');//钱包买单

        Route::rule('miniapp/getBuyMoneyPayment','miniapp.buy.Buy/buyMoneyPayment');//余额支付买单

        Route::rule('miniapp/CreatePinTuanGoodsOrder','miniapp.goods.PinTuan/createOrder');//拼团商品下单

        Route::rule('miniapp/getPintuanMallPayment','miniapp.payment/getPintuanMallPayment');//拼团商品下单微信支付

        Route::rule('miniapp/pinTuanPlatformMoneyPay','miniapp.goods.PinTuan/platformMoneyPay');//拼团商品下单钱包支付

        Route::rule('miniapp/PinTuanMoneyPay','miniapp.goods.PinTuan/moneyPay');//拼团商品下单储值卡支付
        Route::rule('miniapp/getPartnerInfo','miniapp.member.Partner/getPartnerInfo');

        Route::rule('miniapp/getPartnerCustomer','miniapp.member.Partner/getPartnerCustomer');

        Route::rule('miniapp/getPartnerCommission','miniapp.member.Partner/getPartnerCommission');

        Route::rule('miniapp/getPartnerQrCode','miniapp.member.Partner/getPartnerQrCode');

        Route::rule('miniapp/getPartnerWithdraw','miniapp.member.Partner/getPartnerWithdraw');

        Route::rule('miniapp/partnerWithdrawAct','miniapp.member.Partner/partnerWithdrawAct');

        Route::rule('miniapp/getPosterList','miniapp.member.Partner/getPosterList');

        //分享礼包
        Route::rule('miniapp/getPartnerGiftbagList','miniapp.member.Partner/getPartnerGiftbagList');

        Route::rule('miniapp/getGiftbagInfo','miniapp.member.Coupon/getGiftbagInfo');//获取礼包详情

        Route::rule('miniapp/getGiftbagCoupon','miniapp.member.Coupon/getGiftbagCoupon');//一键领取礼包优惠券

        //购买会员
        Route::rule('miniapp/getLevelList','miniapp.Level/index');
        Route::rule('miniapp/createLevelOrder','miniapp.Level/createOrder');
        Route::rule('miniapp/getLevelMoneyPay','miniapp.Level/moneyPay');
        Route::rule('miniapp/getLevelPlatformMoneyPay','miniapp.Level/platformMoneyPay');
        Route::rule('miniapp/getLevelPayment','miniapp.payment/getLevelPayment');

        //其他信息
        Route::rule('miniapp/otherInfo','miniapp.member.Member/info');
    })->middleware([\app\stores\middleware\MiniappCheck::class,\app\stores\middleware\PlatformMemberCheck::class]);

    //订单回调

    Route::group(function (){

        Route::rule('miniapp/goodsMallRespond/:shop_id','miniapp.payment/goodsMallRespond');//商城订单支付回调

        Route::rule('miniapp/buyRespond/:shop_id','miniapp.payment/buyRespond');//买单订单支付回调

        Route::rule('miniapp/pintuanMallRespond/:shop_id','miniapp.payment/pintuanMallRespond');//拼团微信支付回调

        Route::rule('miniapp/levelRespond/:shop_id','miniapp.payment/levelRespond');//付费等级微信支付回调

    })->middleware(\app\stores\middleware\MiniappCheck::class);

    //推广中心
    Route::group(function (){
        Route::rule('miniapp/teamList','miniapp.promotion.Index/teamList');
    })->middleware([\app\stores\middleware\PlatformCheck::class,\app\stores\middleware\PlatformMemberCheck::class]);

    Route::group(function (){
        Route::rule('miniapp/teamList','miniapp.promotion.Index/teamList');
        Route::rule('miniapp/teamActivityList','miniapp.promotion.TeamActivity/list');
        Route::rule('miniapp/saveTeamActivityStatus','miniapp.promotion.TeamActivity/saveStatus');
        Route::rule('miniapp/saveTeamCommission','miniapp.promotion.TeamActivity/saveTeamCommission');
        Route::rule('miniapp/teamActivityDetail','miniapp.promotion.TeamActivity/detail');
        Route::rule('miniapp/activityDetail','miniapp.promotion.SelectCenter/detail');
        Route::rule('miniapp/selectCenterList','miniapp.promotion.SelectCenter/getList');
        Route::rule('miniapp/addTeamActivity','miniapp.promotion.SelectCenter/addTeamActivity');
        Route::rule('miniapp/promotion/member_add','miniapp.promotion.Index/member_add');
        Route::rule('miniapp/promotion/member_list','miniapp.promotion.Index/member_list');
        Route::rule('miniapp/promotionGetQrcode','miniapp.promotion.TeamActivity/getQrcode');
        Route::rule('miniapp/promotionInfo','miniapp.promotion.Member/info');
        Route::rule('miniapp/promotionWithdraw','miniapp.promotion.Index/withdraw');
        Route::rule('miniapp/PromotionMoneyDetail','miniapp.promotion.Member/moneyDetail');
        Route::rule('miniapp/promotion/member_del','miniapp.promotion.Index/member_del');
    })->middleware([\app\stores\middleware\PlatformCheck::class,\app\stores\middleware\PlatformMemberCheck::class,\app\stores\middleware\PromotionCheck::class]);

})->middleware(\app\stores\middleware\Base::class);
